package designPatterns.P05_适配器模式_Adapter.P02_对象适配器_ObjectAdapter.appliances;

import designPatterns.P05_适配器模式_Adapter.P02_对象适配器_ObjectAdapter.voltages.Voltage;

public class Phone implements Appliance {
    @Override
    public void charge(Voltage voltage) {
        if (voltage.getV() == 5) {
            System.out.println("电压为5V，可以充电。");
        } else {
            System.out.println("电压不为5V，不能充电！");
        }
    }
}
